package com.hwtx.form.persistence.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 角色数据权限属性配置表
 * </p>
 *
 * @author baomidou
 * @since 2025-08-25
 */
@Getter
@Setter
@ToString
@TableName("sys_role_data_perm_pro")
public class SysRoleDataPermPro implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 角色id
     */
    @TableField("role_id")
    private Long roleId;

    /**
     * 数据权限配置
     */
    @TableField(value = "data_perm_config", insertStrategy = FieldStrategy.ALWAYS, updateStrategy = FieldStrategy.ALWAYS)
    private String dataPermConfig;

    /**
     * 菜单id
     */
    @TableField("menu_id")
    private Long menuId;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 创建人ID
     */
    @TableField(fill = FieldFill.INSERT)
    private String createId;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    /**
     * 更新人ID
     */
    @TableField(fill = FieldFill.UPDATE)
    private String updateId;


    @Data
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    public static class ResourceDataPermConfig {
        String modelName;
        Object value;
    }
}
